<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>

<head>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
<title>Increment</title>
<script language="JavaScript">

    szNavVersion = navigator.appVersion

    if (navigator.appName == "Microsoft Internet Explorer") {
	if (szNavVersion.indexOf ("4.") >= 0) {
	    document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
	} else {
	    document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
	}
    }
    else if (navigator.appName == "Netscape") {
	document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
    }
    else {
	document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
    }

</script>

<meta NAME="DESCRIPTION" CONTENT="Internet Information Server reference information">
</head>

<body BGCOLOR="#FFFFFF" TEXT="#000000">
<font face="Verdana, Arial, Helvetica">

<h1><a name="_increment"></a>Increment</h1>

<p>The <b>Increment</b> method takes the name of a counter, adds 1 to the current value of
the counter, and returns the counter's new value. If the counter doesn't exist, the method
creates it and sets its value to 1.</p>

<h2>Syntax</h2>

<pre><b>Counters.Increment</b>(<i>CounterName</i>)
 </pre>

<h2>Parameters</h2>

<dl>
  <dt><i>CounterName</i></dt>
  <dd>A string containing the name of the counter.</dd>
</dl>

<h2>Example</h2>

<p>Increment the value of a counter with <code>&lt;% Counters.Increment(<i>CounterName</i>)
%&gt;</code>. Increment and display the value of a counter with <code>&lt;%=
Counters.Increment(<i>CounterName</i>) %&gt;</code>. </p>

<p>To retrieve the value of a counter, use <b>Counters.Get</b>. To set a counter to a
specific value, use <b>Counters.Set</b>. </p>

<p>The following code implements a one-line page-hit counter. </p>

<pre>&lt;P&gt;There have been &lt;%= Counters.Increment(&quot;hits&quot;) %&gt; visits to this Web page. &lt;/P&gt;
 </pre>

<p>In this example, <b>Counters.Increment </b>increases the counter by one each time the
client requests the page from the server. </p>

<h2>Applies To</h2>

<p>Counters component</p>

<h2>See Also</h2>

<p><a href="counter2.htm"><b>Get</b></a>, <a href="counter4.htm"><b>Remove</b></a>, <a
href="counter5.htm"><b>Set</b></a> </p>
</font>
</body>
</html>
